package com.yyks.es.dubbo.pojo.vo.search;

import cn.hutool.json.JSONUtil;
import com.yyks.es.dubbo.pojo.model.EsRoomInfo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class HotelInfoHotelUnionSearchVoRoom extends EsRoomInfo {

    //最低的价格
    private Integer minPrice;
    //市场参考价
    private Integer referencePrice;
    //最低的房间数
    private Integer minCount;
    //图片
    private List<String> images;
    //房态列表
    private List<HotelInfoHotelUnionSearchVoCalendar> calendars;

    public List<String> getImages() {
        try {
            if (Objects.isNull(this.images)) {
                this.images = JSONUtil.parseObj(getExtraInfo()).getJSONArray("imgUrlList").toList(String.class);
            }
            return this.images;
        } catch (Exception e) {
            return new ArrayList<>();
        }
    }

}
